#include "mainwindow.h"
#include "ui_mainwindow.h"

MainWindow::MainWindow(QWidget *parent)
    : QMainWindow(parent)
    , ui(new Ui::MainWindow)
{
    ui->setupUi(this);
    //连接信号槽
    connect(&thread,&myThread::notify,this,[this]()
    {
        int value=ui->lcdNumber->intValue();
        //if(value<=0) return;

        ui->lcdNumber->display(--value);
    });
    //启动线程
    thread.start();

}

MainWindow::~MainWindow()
{
    delete ui;
}

